import { Rules, Value } from "async-validator";
import { InjectionKey } from "vue";

export type FormData = {
  model: Record<any, any>;
  rules?: Rules;
};

export type FormItem = {
  validator: () => Promise<Value>;
};

export const key: InjectionKey<FormData> = Symbol("form-data");
